  <?php if(!empty($id)) { ?>
 <form action="<?= $member_base_url; ?>upload_form/edit/<?=$id;?>/<?php echo $cur_page;?>" method="post" id="country_form" enctype="multipart/form-data">
 <?php } else { ?>
 <form action="<?= $member_base_url; ?>upload_form/select_country/<?= $cur_page;?>" method="post" id="country_form" enctype="multipart/form-data">
 <?php } ?>
 
 <br/>
 <?php
// print_r($student);
if(!empty($form))
{
 foreach ($form as $f)
 {
	 echo "<input class='radio' type='radio' ";
	 if($f['id']==$student['country_id'])
	 echo "checked ";
	 echo "name='country_id' value='".$f['id']."'/>".$f['countries']."<br/>";
 }
 
 ?>
   
			<div class="buttons">
			    <button type="submit" name="save" class="submit" value="save" >
			        <img src="<?php echo $member_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($id)) { ?>
 							Update 
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else { ?>
 					  	Add 
 					  	<?php } ?>

 			    </button>
			   <a href="<?= $member_base_url; ?>student/account" class="negative">
			        <img src="<?php echo $member_image_path?>icons/cross.png" alt=""/>
			        Cancel
			   </a>
			</div>
	 <br/><br/><br/>
 </form>
 <?php }
 else
 {
	 echo "No forms uploaded";
 }
  ?>
 <script>
 $(document).ready(function() {
     $("#course_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,name,Please enter name."
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>